# Makefile pro zaverecnou zpravu
SHELL=/bin/bash
NAME=report-mk

# implicitni cile
.PHONY: all docbook html pdf view-html view-pdf clean
all: docbook html pdf
docbook: ${NAME}.xml
html: ${NAME}.html
pdf: ${NAME}.pdf

# prevod do docbooku
${NAME}.xml: ${NAME}.txt
	asciidoc -a lang=cs -a ascii-ids -b docbook ${NAME}.txt

# prevod do html
${NAME}.html: ${NAME}.txt
	asciidoc -a lang=cs -a max-width=1000px -b html ${NAME}.txt

# prevod do pdf
DBLATEX_OPTS=-P latex.output.revhistory=0 -P doc.collab.show=0
${NAME}.pdf: ${NAME}.xml
	dblatex ${DBLATEX_OPTS} ${NAME}.xml

# uklid
clean:
	-rm ${NAME}.{xml,html,pdf}

# okamzite prohlizeni
view-html: ${NAME}.html
	google-chrome ${NAME}.html &

view-pdf: ${NAME}.pdf
	evince ${NAME}.pdf &
